Skip to content

stability: always enable zram (drop memory-total gate)#756

Open
cyberb wants to merge 3 commits into
masterfrom
zram-always-on
Open

stability: always enable zram (drop memory-total gate)#756
cyberb wants to merge 3 commits into
masterfrom
zram-always-on

Conversation

@cyberb

@cyberb cyberb commented Jul 9, 2026

Copy link
Copy Markdown
Member

What

Remove the 6 GiB MemTotal gate in backend/stability/zram.go so EnsureConfigured() always configures zram, regardless of total/available RAM.

Why

The gate skipped exactly the boxes that benefit most: high-RAM but heavily-loaded machines (e.g. boris prod — 8 GB, ~15 snaps) fell above the 6 GiB threshold and never got compressed swap. Compressed swap is cheap headroom on any box, and alreadyOn() keeps configuration idempotent, so unconditional enable is safe.

Resolves the "Decision needed: how to lift the gate" item in TODO-zram-health.md (the Health-page si/so + iowait visibility work remains open).

Changes

  • zram.go: drop memThresholdKB and the skip branch.
  • zram_test.go: remove the now-obsolete above-threshold skip test.
  • TODO-zram-health.md: record the decision (gate removed, always-on).
  • TODO.md: drop gptfdisk from the 3rdparty migration list (already migrated in-tree).

Test

go test ./stability/ passes locally.

cyberb added 3 commits July 9, 2026 08:47
Compressed swap is cheap headroom even on high-RAM boxes; the 6 GiB
MemTotal gate skipped exactly the pressured 8 GB multi-snap boxes (boris
prod) that benefit most. Remove the gate so EnsureConfigured always
configures zram; alreadyOn() keeps it idempotent.
Old buster kernels (4.19) expose zram comp_algorithm without zstd
([lzo] lz4 lz4hc). Writing zstd there fails EINVAL, which aborted
EnsureConfigured before disksize/swapon, so zram never came up. zram
already has a working default algorithm, so treat the comp_algorithm
write as best-effort and only require disksize. Surfaced on borisarm64
(amd64 buster) once the memory gate was removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant